#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    // 连接信号槽
    connect(&thread,&Thread::notify,this,&Widget::handle);

    // 启动线程
    thread.start();
    ui->lcdNumber->display(10);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    int val = ui->lcdNumber->value();
    val--;
    ui->lcdNumber->display(val);
}
